package com.craney.ObjectScript
{
	public class ObjectScript
	{
		public function ObjectScript()
		{
			var o:Object = {name:"Craney"};

			trace("o.name = " + o.name);		//  Craney
			trace("o['name'] = " + o["name"]);	//  Craney
			
//			trace(o[name]);			//编译出出错，没有这个变量 name   若有：	var name:String = "uname";  则正确，name 会换算成 "uname"

			var s:String = "name";
			trace("o.s = " + o.s);				//  undefined
			trace("o[s] = " + o[s]);  			//  换算成 "name"  输出：Craney
			
			trace("o[0] = " + o[0]);			//	输出undefined  若定义成：	
												//  var o:Object = {name:"Craney", 0:"ssssss"};
												//	var o:Object = {name:"Craney", "0":"ssssss"};
												//  则输出：ssssss
												
//			trace(o.0);							//  编译出出错！ 不能 .0 
			
			var j:int = 0;
			trace("o[j] = " + o[j]);			//  输出undefined  同上
		}

	}
}